#ifndef TIM_JIZHI_GNIS_H
#define TIM_JIZHI_GNIS_H
#include <sys/types.h>
#include <cstdint>
#include <cstring>


#if 0
#pragma pack(push, 1)
typedef struct GnisProtocol{
	//data lens
	uint16_t m_dataLens;
	//data type
	uint16_t m_dataType;
	// save byte 00
	uint16_t m_save;
	// gps week
	int32_t m_week;
	// gps secondes 8 byte
	double m_second;
	// latitude  1e-7
	int32_t m_lat;
	// longitude 1e-7
	int32_t m_lng;
	//alt m 1e-3
	int32_t m_alt;
	//East speed  m/s  1e2/32768
	int16_t m_eastSpeed;
	//North speed m/s 1e2/32768
	int16_t m_northSpeed;
	//sky speed m/s 1e2/32768
	int16_t m_skySpeed;
	//pitch deg 360/32768
	int16_t m_pitch;
	//roll deg 360/32768
	int16_t m_roll;
	//yaw deg 360/32768
	int16_t m_yaw;
	//x acc g 8/32768
	int16_t m_accX;
	//y acc g 8/32768
	int16_t m_accY;
	//z acc g 8/32768
	int16_t m_accZ;
	//x gyo deg/s 250/32768
	int16_t m_gyoX;
	//y gyo deg/s 250/32768
	int16_t m_gyoY;
	//z gyo deg/s 250/32768
	int16_t m_gyoZ;
	//gnis status
	uint8_t m_gnisStatus;
} GnisProtocolType;
#pragma pack(pop)


bool ProtocolParseChar(GnisProtocolType *recvMessage, uint8_t c);

#else
#pragma pack(push, 1)
typedef struct GnisProtocol{
	int16_t m_roll;
	int16_t m_pitch;
	int16_t m_yaw;
	uint8_t m_year;
	uint8_t m_month;
	uint8_t m_day;
	uint8_t m_hour;
	uint8_t m_minute;
	uint8_t m_second;
	int32_t m_lat;
	int32_t m_lng;
	int16_t m_alt;
}GnisProtocolType;
#pragma pack(pop)


bool ProtocolParseChar(GnisProtocolType *recvMessage, uint8_t c);
#endif
#endif //TIM_JIZHI_GNIS_H